import { Component } from "react";
import {
    createBrowserRouter,
    RouterProvider,
    HashRouter,
    Route,
    Routes,
    Navigate
} from "react-router-dom";
import FilmsCom  from "../views/FilmsCom";
import  CineMas  from "../views/cinemas";
import  CenTer  from "../views/center";
import ErrorPage from "../views/ErrorPage";
import ConimgSoon from "../views/films/conimgsoon";
import NowplayIng from "../views/films/nowplaying";
// export const IndexRouter = createBrowserRouter([
//     {
//         path: "/FilmsCom",
//         element: <FilmsCom />
//     },
//     {
//         path: "/CineMas",
//         element: <CineMas />
//     },
//     {
//         path: "/CenTer",
//         element: <CenTer />
//     },
//     {
//         path: "/",
//         element: <FilmsCom/>
//     }
// ])
export function MRouter() {
    return (
        <Routes>
            <Route path="/FilmsCom" element={<FilmsCom />} >
                <Route path="/FilmsCom/conimgsoon" element={<ConimgSoon />}></Route>
                <Route path="/FilmsCom/nowplaying" element={<NowplayIng />}></Route>

            </Route>
            <Route path="/CineMas" element={<CineMas />} />
            <Route path="/CenTer" element={<CenTer />} />
            <Route path="/" element={<Navigate to='/FilmsCom'/>} />
            <Route path="*" element={<ErrorPage />} />

      </Routes>
    )
}
